<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>prop验证</title>
    <script src="../js/vue-dev.js"></script>
</head>
<body>
    <div id="app_prop">
        <!--<input v-model="message"><br>-->
        <!--<my-comp v-bind:parent-message="message"></my-comp>-->

        <my-comp parent-message="asd"></my-comp>
    </div>

    <script>
        Vue.component('my-comp',{
            //验证应该模板之前
            props:{
                propA: {
                    type: String,
                    required: true
                },
            },
            props:['parentMessage'],
            template:"<span>显示的数据为: {{parentMessage}}</span>",

        })
        var app_prop = new Vue({
            el:"#app_prop",
            data:{
                message:'',
            }
        })

    </script>



</body>
</html>